<?php
/**
 * Joomla! 1.5 component JoomGPSTracks
 *
 * @version $Id: helper.php 2009-06-24 15:40:19 svn $
 * @author Michael Pfister
 * @package joomGPStracks
 * @subpackage backend
 * @license GNU/GPL
 * @filesource
 *
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

/**
 * JoomGPSTracks Helper
 *
 */
class JoomgpstracksHelper {
    /**
     *
     * @global object $mainframe
     * @return object
     */
    function getConfig()  {
        global $mainframe;

        $db =& JFactory::getDBO();

        $query = "SELECT * FROM #__gps_config WHERE id='1'";

        $db->setQuery($query);
        $result = $db->loadObject();

        if ($db->getErrorNum()) {
            echo $db->stderr();
            return false;
        }

        return $result;
    }
    
}

function checkCaptcha()  {
    global $mainframe;

    $db = JFactory::getDBO();

    $query ="SELECT id FROM #__plugins WHERE element='captcha'";
    $db->setQuery($query);
    $result = $db->loadResult();

    return $result;
}
?>